#include<stdio.h>
#include<stdlib.h>
struct {
	int num;
	char name[20];
	char sex;
	char job;
	union {
		int clas;
		char position[20];
	}category;
}person[2];
int main()
{
	int i;
	for (i = 0; i < 2; i++)
	{
		printf("please input the data of person.\n");
		scanf_s("%d %s %c %c ", &person[i].num, &person[i].name, &person[i].sex, &person[i].job);
		if (person[i].job == 's')
			scanf_s("%d", &person[i].category.clas);
		else if (person[i].job == 't')
			scanf_s("%s", person[i].category.position);
		else
			printf("Input error!\n");
	}
	printf("\n");
	printf("NO.   name   sex   job  class\position\n");
	for (i = 0; i < 2; i++)
	{
		if (person[i].job == 's')
			printf("%d   %s   %c   %c   %d", person[i].num, person[i].name, person[i].sex, person[i].job, person[i].category.clas);
		else if (person[i].job == 't')
			printf("%d   %s   %c   %c   %d", person[i].num, person[i].name, person[i].sex, person[i].job, person[i].category.position);
		else
			printf("Input error!\n");
	}
	return 0;
}